package com.wondedDream.repository;

import com.wondedDream.model.PracticeQuestion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PracticeQuestionRepository extends JpaRepository<PracticeQuestion, Integer> {
    // 新增的自定义查询方法
    @Query("SELECT p FROM PracticeQuestion p WHERE p.practice.id = :practice")
    List<PracticeQuestion> getPracticeQuestionsByPracticeId(Integer practice);

    Integer countByPracticeId(Integer practiceId);
}